How To Use Sized Overflow Box Widget Using Flutter

admin_img Posted By Bajarangi soft , Posted On 27-11-2020

A widget that is a specific size but passes its original constraints through to its child, which may then overflow.

How To Use Sized Overflow Box Widget Using Flutter

Sized Overflow Box Widget 
Complete Code For Sized Overflow Box Widget  In Flutter
main.dart

import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}
class MyHomePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => MyHomePageState();
}

class MyHomePageState extends State<MyHomePage> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.green,
          title: Text("SizedOverflowBox Widget")),
      body: Center(
        child: SizedOverflowBox(
          size: Size(50.0, 50.0),
          child: Container(
            height: 50.0,
            width: 50.0,
            color: Colors.green,
          ),
        ),
      ),
    );
  }
}

Related Post